Skip to content

test(runtimes): check that generated modules actually run - #31

Closed
TomChv wants to merge 2 commits into
feat/library-testsfrom
feat/runtime-execution-tests
Closed

test(runtimes): check that generated modules actually run#31
TomChv wants to merge 2 commits into
feat/library-testsfrom
feat/runtime-execution-tests

Conversation

@TomChv

@TomChv TomChv commented Aug 19, 2026

Copy link
Copy Markdown
Member

Every other check inspects what generation writes. None loaded the result — so
the contract the whole move rests on was verified only by hand: sdk/ resolving
as @dagger.io/dagger, the bundle it holds being loadable, the entrypoint
importing the user's classes and registering them. A break there is a module
that generates cleanly and fails at dagger call.

Loading a module is enough to force it. A dagger-module.toml module does no
codegen at call time, and the TypeScript SDK has no ModuleTypes function, so
reading its objects builds the runtime container and executes the generated
entrypoint.

One fixture per runtime, because this is where they stop being interchangeable:
generation differs only in which config file it writes, but node, bun and deno
each execute the entrypoint in a different container with a different
interpreter. Bun had never been run at all — it was dismissed as taking node's
code path, which is true of generation and false of execution.

Staged with withChanges rather than written to disk, which also keeps the
fixtures free of generated output and sidesteps a module's own .gitignore
hiding its generated files from the engine's module context.

Confirmed each check fails when the fixture's object is renamed.

Signed-off-by: Tom Chauveau tom@dagger.io


Stack created with GitHub Stacks CLIGive Feedback 💬

@TomChv
TomChv force-pushed the feat/runtime-execution-tests branch 2 times, most recently from 33da82f to c0a0499 Compare August 25, 2026 16:06
@TomChv
TomChv marked this pull request as ready for review August 25, 2026 16:15
@TomChv
TomChv force-pushed the feat/runtime-execution-tests branch from c0a0499 to 8cde01f Compare August 28, 2026 11:24
@TomChv
TomChv force-pushed the feat/runtime-execution-tests branch from 8cde01f to 2feb073 Compare August 28, 2026 12:26
TomChv added 2 commits August 28, 2026 15:02
Every other check inspects what generation writes. None loaded the result — so
the contract the whole move rests on was verified only by hand: sdk/ resolving
as @dagger.io/dagger, the bundle it holds being loadable, the entrypoint
importing the user's classes and registering them. A break there is a module
that generates cleanly and fails at `dagger call`.

Loading a module is enough to force it. A dagger-module.toml module does no
codegen at call time, and the TypeScript SDK has no ModuleTypes function, so
reading its objects builds the runtime container and executes the generated
entrypoint.

One fixture per runtime, because this is where they stop being interchangeable:
generation differs only in which config file it writes, but node, bun and deno
each execute the entrypoint in a different container with a different
interpreter. Bun had never been run at all — it was dismissed as taking node's
code path, which is true of generation and false of execution.

Staged with withChanges rather than written to disk, which also keeps the
fixtures free of generated output and sidesteps a module's own .gitignore
hiding its generated files from the engine's module context.

Confirmed each check fails when the fixture's object is renamed.

Signed-off-by: Tom Chauveau <tom@dagger.io>
Loading a module proves the entrypoint registers its types. This proves the
other half of the dispatcher: that a call reaches the user's code and its
return value comes back.

sdk-sdk's harness already drives a release CLI through the whole user path —
`sdk install`, `module init`, `generate` — so the call is one more command on
the state it leaves behind. What its harness cannot do is init with a
`--runtime` flag: initArgs is private and fixed, and a run's container is not
exposed, so the per-runtime checks still build their own module. A seam there
would be worth proposing upstream.

The function is the default template's baseImageAddress, whose value the
module's constructor sets, so a passing call also means the constructor ran and
its default was applied. Confirmed by changing that default and watching the
check report the new value.

Signed-off-by: Tom Chauveau <tom@dagger.io>
@TomChv
TomChv force-pushed the feat/runtime-execution-tests branch from 2feb073 to a11b109 Compare August 28, 2026 13:17
@TomChv

TomChv commented Aug 28, 2026

Copy link
Copy Markdown
Member Author

Superseded by #39, which squashes this whole stack into a single PR off main (same tree, byte for byte).

The stack had PRs overwriting each other — this one included — which made the intermediate states hard to reason about, and thirteen PRs each fanning out a full check suite made CI unreadable. Branch is left pushed, so nothing here is lost.

@TomChv TomChv closed this Aug 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants